package edu.yctc.delivery.service;

import edu.yctc.delivery.entity.ResultDO;
import edu.yctc.delivery.entity.UserDO;

public interface UserService {

    /**
     * 通过id返回userDO
     * 
     * @param id
     * @return
     */
    public ResultDO<UserDO> getUserDOById(long id);

    /**
     * 登陆
     * 
     * @param userDO
     * @return
     */
    public ResultDO<Long> signin(UserDO userDO);

    /**
     * 通过mail来获得UserDO
     * 
     * @param mail
     * @return
     */
    public ResultDO<UserDO> getUserDOByMail(String mail);

    /**
     * 通过phone来获得UserDO
     * 
     * @param mail
     * @return
     */
    public ResultDO<UserDO> getUserDOByPhone(String phone);

    /**
     * 注册
     * 
     * @param userDO
     * @return
     */
    public ResultDO<Long> register(UserDO userDO);

    /**
     * 更改密码
     * 
     * @param id
     * @return
     */
    public ResultDO<Void> ChangePassword(UserDO userDO, String password);

    /**
     * 修改邮箱
     * 
     * @param userDO
     * @param mail
     * @return
     */
    public ResultDO<Void> updateMail(UserDO userDO, String mail);

    /**
     * 通过账号找到userDO
     *
     * @param account
     * @return
     */
    public ResultDO<UserDO> getUserDOByAccount(String account);

    /**
     * 修改电话
     * 
     * @param userDO
     * @param phone
     * @return
     */
    public ResultDO<Void> updatePhone(UserDO userDO, String phone);
}
